/*
    This file is part of Epoch <http://code.google.com/p/epoch/>.
    
    Copyright (C) 2011  Adam Meily <meily.adam@gmail.com>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/


#include "Share.h"

Share::Share()
{

}

Share::Share(const Share& other)
{

}

Share::~Share()
{

}

Share& Share::operator=(const Share& other)
{
    m_name = other.m_name;
    m_path = other.m_path;
    m_uuid = other.m_uuid;
    return *this;
}

const QString& Share::name() const
{
    return m_name;
}

const QString& Share::path() const
{
    return m_path;
}

const QByteArray& Share::uuid() const
{
    return m_uuid;
}

bool Share::isNull() const
{
    return m_uuid.isEmpty();
}

Share Share::fromRecord(const Record& record)
{
    QString path = record["path"];
    QString suuid = record["uuid"];
    QString name = record["name"];
    
    Share share;
    
    if(!path.isEmpty() && !suuid.isEmpty())
    {
        
    }
    
    return share;
}

Record Share::toRecord() const
{
    Record r;
    r.insert("path", m_path);
    r.insert("uuid", m_uuid.toHex());
    r.insert("name", m_name);
    return r;
}


